import { IParam, IViewAbility } from '@/core';

//  全局通知行为
export type GlobalNotificationAction = 'refresh';

/**
 * 全局通知助手接口
 *
 * @export
 * @interface IGlobalNotificationHelper
 */
export interface IGlobalNotificationHelper {
	/**
	 * 全局通知
	 *
	 * @param {string} tag 通知标识
	 * @param {GlobalNotificationAction} action 行为
	 * @param {(IParam | IParam[])} [data] 数据
	 * @memberof IGlobalNotificationHelper
	 */
	notice(
		tag: string,
		action: GlobalNotificationAction,
		data?: IParam | IParam[]
	): void;

	/**
	 * 设置能力
	 *
	 * @param {string} tag 通知标识
	 * @param {IViewAbility} ability 能力
	 * @memberof IGlobalNotificationHelper
	 */
	setAbility(tag: string, ability: IViewAbility): void;

	/**
	 * 销毁能力
	 *
	 * @param {string} tag 通知标识
	 * @param {IViewAbility} ability 能力
	 * @memberof IGlobalNotificationHelper
	 */
	destroyAbility(tag: string, ability: IViewAbility): void;
}
